package com.wooophone.mpyeah.biz.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.wooophone.mpyeah.biz.RealStoreBiz;
import com.wooophone.mpyeah.biz.exception.CannotDeleteException;
import com.wooophone.mpyeah.dao.RealStoreDao;
import com.wooophone.mpyeah.entity.RealStore;

public class RealStoreBizImpl implements RealStoreBiz {
	
	@Autowired
	RealStoreDao realStoreDao;
	public void setRealStoreDao(RealStoreDao realStoreDao) {
		this.realStoreDao = realStoreDao;
	}

	@Override
	public RealStore save(RealStore obj) {
		return realStoreDao.save(obj);
	}

	@Override
	public int update(RealStore obj) {
		return realStoreDao.update(obj);
	}

	@Override
	public int delete(String id) throws CannotDeleteException {
		return realStoreDao.delete(id);
	}

	@Override
	public RealStore get(String id) {
		return realStoreDao.get(id);
	}

	@Override
	public List<RealStore> list() {
		return realStoreDao.list();
	}

	@Override
	public List<RealStore> list(int offset, int limit) {
		return realStoreDao.list(offset, limit);
	}

	@Override
	public int count() {
		return realStoreDao.count();
	}

	@Override
	public List<RealStore> find(Map<String, Object> parameter) {
		return realStoreDao.find(parameter);
	}

	@Override
	public List<RealStore> find(Map<String, Object> parameter, int offset, int limit) {
		return realStoreDao.find(parameter,offset,limit);
	}

	@Override
	public int count(Map<String, Object> parameter) {
		return realStoreDao.count(parameter);
	}

	@Override
	public int count(String keyword) {
		return realStoreDao.count(keyword);
	}

	@Override
	public List<RealStore> search(String keyword, int offset, int limit) {
		return realStoreDao.search(keyword, offset, limit);
	}
	
	public int countByBrandId(String brandId){
		return realStoreDao.countByBrandId(brandId);
	}
}
